Skip to main content

clone

Type

command

Summary

Duplicates an object.

Syntax

clone [invisible] <object> [as <newName>]

Description

Use the clone command to create a copy of an existing object.

If the object is a control, its copy is placed on the current card, 32 pixels below and to the right of the original object. The copy's name and other properties are the same as those of the original. If the object is a grouped control, the clone is also owned by the group.

note

If invisible is specified the new object will have its visible property set to false.

If the object is a card, the copy becomes the current card.

If the object is a stack, the newly created stack is opened. It is named "Copy of" and the stack's name.

The clone command does not affect the contents of the clipboard.

If the 'as' variant is used, the newly created object is given the specified name.

Parameters

NameTypeDescription

object

An object or stack reference or an expression that resolves to either.

newName

An optional name for the new object.

Examples

clone field 1
clone the selectedObject
clone this card as "clonedCard"
clone invisible stack "myStack"

property: pixels, properties, name

command: create card, paste, group, copy, create stack

function: clipboard

glossary: object, grouped control, current card, owner, command

keyword: card, control, it

message: newAudioclip, newButton, newCard, newGroup, newPlayer, newGraphic, newField, newScrollbar, newEPS, newImage, newVideoclip

object: stack

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?